package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000116694778";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC/vPW9Ugu28HMLxUu++tajz+DJxOLxgy+o8YAhkae2DGFjIPmAiG6S6WXNpsSRjg0THRfTGhfndczIxAf6JwDzxbMhVXaWV18qHl0B9eMdoXMm2NwXMgktIoVVBaqu8yATr7zHITe4ym/ZHiSnMM8wlwUIe4l6SBqUVcy1xqXHYREC4WSsAcZnp/AqXHzC6k7MBGU/r/0W2WmihOoANDvYrQSnEBc05NmlXAg4B/tNBAUukDlNKH4/W6aHF6iO5Fbq3s9/p2I1SAZqtYaY9Qg6lB50c/vBOs2goA2eXJn2RxkwNkbjWzCoNictKUqHOJ1af7CVumvjKK6jQGQpvtsLAgMBAAECggEAYuSJMq6AkEiQbf/Cw6wIzNDJNggwrTRmfpKg7a98eu8Dw+ccCOlVbrym310mgZRstfEJer44mg8uIlbJboJzgUf0zjqQQZaq5MRoYDx8eanuBJlRWz1Zckgd0O5tTHLlloHLskE1xj/TVH6xlPIdywf5dpiRHdrWqq9eOFtO4fgOa5G7hBmYYoQe/2OR4EbsoECO4vy2jjORvOTFfuDghlFFu3gkvwfM847bMHySxy766XV9PSpkxcDRn+RNwLcbzX5Cs65JWNdmLjFu6ZZkACEeAuvS4OqlcU5SRZKIZFPooiIk4RaD+LD2Lz5VjFhcEk4Cx0RD7XWqKF63Ejlg8QKBgQD5p0y+tXWHcKfGd0A50DhX8h1ooshMy/ijmmpuITnHE/I0bsWF5KAirS3a2D100eoZGP897dRgiyi6F2CjpLo9O59X5FjqJNTm+qARBprANkRcqrbBlJ8+KF1oRH7ts00J1a/tyPZy5UDFdFGsMaWx2J0xZNAeaZ8Fr85jvQi59QKBgQDEnMHWvN/qHD5MuSo3rgcRj8dlhlLnHim8vjZd2iyFhvYweUICB2RTo9u57bC4aEZ76sm/alvAJ5t1PS9ZlDLSM38FzrVDnd80TGKcINiYdXOQQcfYydKC2kdQe6cg8qZZpkTrnGuUZqkcGs8w1Mtma6X2CkhLy6cjlMEt7zMg/wKBgBVBlVs3gAZEJUTUqndBr0ptputd0MgZJdZoM1+lHJJCtICaXd8ElE3fiOP1PWZQ6Smx4ymWslp1/sW5b9T/FYxZIzwMiTWGZUo1VKOeeFadSDzLnDvnN5fHQAy8qEH83jZUJ2KLldA6jMVDHiEXKRB3bQrjloTAYXXOfjgnxDJxAoGAGCc1vN6ZF1Z+5Mf+graTUbn7AeLdflz7PZ+UaDUsMP8icVQEIuGrlobTsGSdyBmvRvvR6vzy5ok3FND+Zx/ImoAPA7SgGf1j9TXJC2sRkLElEDy0g1JP1Rlhl2aJYofMncjKQLOHl8SA094LQ/FwR1XEHpSmywDquHlGvhDblBsCgYBQPeGAwhjV+eZMjXLLvfDTBXibnRcq1ABLRM0q9G+Ke3gxBl/b0usUZ7nhlTTyeK96f6TxIH2+DU8gI8ZaDnSCJmjd679J4eO4yRLascVqoC87LG8lXMJjq+WwAL5aN6gGmXEQqL4eoDHXGiZ/34mVEecjG4iGBFbfwXxryJ5BBw==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxVXt/ZbRyLJD9V1hi9jaEZK6wOI3LFqPBW7Xmc8RjvRU7Eed0O+ku8gudmpL3ehsPuH6BENsIBsNHIDTCVGh+1JBwqaihVz7HwUQR9B05N2vrwKWUhWW5P5lfjySx2D7z35CsIzj4Yt5AvXzjNGvcbOfj9BQFFYtvkEGeuTW/Bj3b6nbdFgxFFnTuaQfJC6fnmncySj0yzjnHK3EfRGqwDt/FOTAwKkdAFwLnFXA7K2LqUQGDiaqnA7ow4UerTrpAAna2onOpRF7DDP+QzDb1c1+9MlE9LfEYerya9mjy1ihqmPdz2+IZIiIpIPjD8N88g6qPCTo5jfYlhY71mmN2wIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/movie/alipay/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/house/alipay/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

